package com.e3.basdoc.warehouse.client;

import java.util.ArrayList;
import java.util.List;

import com.e3.basdoc.warehouse.model.WarehouseModel;
import com.e3.template.tgf.TGFSimpleFormPanel;
import com.extjs.gxt.ui.client.widget.form.Field;

public class WarehouseFormPanel extends TGFSimpleFormPanel<WarehouseModel> {

	@Override
	public List<Field<?>> getFormFields() {
		String[] fNames = {WarehouseModel.ID
				,WarehouseModel.CODE
				,WarehouseModel.NAME
				,WarehouseModel.ADMINISTRATOR
				,WarehouseModel.CONTRACT_WAY
				,WarehouseModel.TYPE
				,WarehouseModel.STATUS
				};
		
		List<Field<?>> fields = new ArrayList<Field<?>>(fNames.length);
		for (String name : fNames) {
			fields.add(WarehouseHelper.INSTANCE.createFormField(name));
		}
		return fields;
	}

	@Override
	public WarehouseModel createModelInstance() {
		return new WarehouseModel();
	}

}
